/******************************************************************************/
/* RAM.INI: RAM Initialization File                                           */
/******************************************************************************/
/* This file is part of the uVision/ARM development tools.                    */
/* Copyright (c) 2005-2012 Keil Software. All rights reserved.                */
/* This software may only be used under the terms of a valid, current,        */
/* end user licence from KEIL for a compatible version of KEIL software       */
/* development tools. Nothing else gives you the right to use this software.  */
/******************************************************************************/

FUNC void Setup (void) {
  // Reset peripherals: LCD, USB0, USB1, DMA, SDIO, ETHERNET, GPIO
  _WDWORD(0x40053100, 0x105F0000);      // Issue reset
  _sleep_(1);

  SP = _RDWORD(0x10000000);             // Setup Stack Pointer
  PC = _RDWORD(0x10000004);             // Setup Program Counter
  XPSR = 0x01000000;                    // Set Thumb bit
  _WDWORD(0xE000ED08, 0x10000000);      // Setup Vector Table Offset Register
  _WDWORD(0x40043100, 0x10000000);      // Set the shadow pointer
}

LOAD %L INCREMENTAL                     // Download

Setup();                                // Setup for Running

g, main
